From 82cb5fd66af910c71deef67d49a5c9e3d319bde9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 15 Sep 2023 16:00:00 -0600 Subject: [PATCH] libubox: Drop extraneous space when appending values to variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Don't have a leading space when building out a variable via appends. Fixes: #15 Signed-off-by: Felix Fietkau Signed-off-by: Philip Prindeville Signed-off-by: Petr Å tetiar [fix fixes trailer] --- sh/jshn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/jshn.sh b/sh/jshn.sh index 1d30557..66ca952 100644 --- a/sh/jshn.sh +++ b/sh/jshn.sh @@ -23,7 +23,7 @@ __jshn_raw_append() { _jshn_append() { # var=$1 local _a_value="$2" - eval "${JSON_PREFIX}$1=\"\${${JSON_PREFIX}$1} \$_a_value\"" + eval "${JSON_PREFIX}$1=\"\${${JSON_PREFIX}$1}\${${JSON_PREFIX}$1:+ }\$_a_value\"" } _get_var() { -- 2.30.2